package cool.houge.ws.packet;

import com.dslplatform.json.CompiledJson;
import com.dslplatform.json.JsonAttribute;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * 消息包.
 *
 * @author ZY (kzou227@qq.com)
 */
@Data
@Accessors(chain = true)
@CompiledJson
public class Packet {

  /** 消息命名空间. */
  private Namespaces ns;
  /**
   * 群组 IDs.
   *
   * @see Namespaces#GROUP_SUBSCRIBE
   * @see Namespaces#GROUP_UNSUBSCRIBE
   */
  @JsonAttribute(name = "group_ids")
  private long[] groupIds;
  /**
   * 消息发送者.
   *
   * @see Namespaces#PRIVATE_MESSAGE
   * @see Namespaces#GROUP_MESSAGE
   */
  private String from;
  /**
   * 消息接收者.
   *
   * @see Namespaces#PRIVATE_MESSAGE
   * @see Namespaces#GROUP_MESSAGE
   */
  private String to;
  /**
   * 消息内容.
   *
   * @see Namespaces#PRIVATE_MESSAGE
   * @see Namespaces#GROUP_MESSAGE
   */
  private String content;
  /**
   * 扩展字段.
   *
   * @see Namespaces#PRIVATE_MESSAGE
   * @see Namespaces#GROUP_MESSAGE
   */
  private String extra;
}
